package com.new2i.dao.mapper;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.new2i.model.EmrNeonatusEntity;

/**
 * 新生儿筛查病历ORM mapper
 * 
 * @author 2i
 * @since 2015/09/03
 */
public interface EmrNeonatusMapper {

	/** 
	 * 新增病历信息
	 * 
	 * @author 2i
	 * @since 2015/09/03
	 * @param emr
	 * @return
	 */
	int insertEmrNeonatus(EmrNeonatusEntity emr); 
	
	/**
	 * 修改病历信息
	 * 
	 * @author 2i
	 * @since 2015/09/04
	 * @param emr
	 * @return
	 */
	int updateEmrNeonatusById(EmrNeonatusEntity emr);
	
	/**
	 * 
	 * 查询用户的病历列表
	 * 
	 * @author 2i
	 * @since 2015/09/04
	 * @param user_id
	 * @param doctor_id
	 * @return
	 */
	List<HashMap<String, Object>> selectEmrListByUserId(@Param("user_id") final int user_id,
			@Param("doctor_id") final int doctor_id);
	
	/**
	 * 
	 * 查询创建用户病历的医生列表
	 * 
	 * @author 2i
	 * @since 2015/09/05
	 * @param user_id 
	 * @return
	 */
	List<HashMap<String, Object>> selectDoctorInfoListByUserId(@Param("user_id") final int user_id);
	 
	/**
	 * 
	 * 查询某条的病历信息
	 * 
	 * @author 2i
	 * @since 2015/09/05
	 * @param emr_neonatus_id 
	 * @return
	 */
	HashMap<String, Object> getEmrInfoById(@Param("emr_neonatus_id") final int emr_neonatus_id);
	
	/**
	 * 通过doctor_id 和 user_id查询最新一条病历
	 * 
	 * @author 2i
	 * @since 2015/09/05
	 * @param user_id
	 * @param doctor_id
	 * @return
	 */
	HashMap<String, Object> getTopEmrByDU(@Param("doctor_id") final int doctor_id, @Param("user_id") final int user_id);
} 
